<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教材版本列表 - 智慧题库管理系统</title>
    <link href="../assets/css/tailwind.css" rel="stylesheet">
    <link href="../assets/css/font-awesome.min.css" rel="stylesheet">
</head>
<body class="font-inter bg-gray-50 min-h-screen flex flex-col bg-education">
    <!-- 背景装饰元素 -->
    <div class="absolute inset-0 overflow-hidden -z-10">
        <div class="absolute top-10 left-10 w-40 h-40 rounded-full bg-primary/10 animate-float">
            <div class="w-full h-full flex items-center justify-center text-primary/20 text-6xl education-icon">
                <i class="fa fa-book"></i>
            </div>
        </div>
        <div class="absolute bottom-20 right-20 w-60 h-60 rounded-full bg-secondary/10 animate-float" style="animation-delay: -2s">
            <div class="w-full h-full flex items-center justify-center text-secondary/20 text-7xl education-icon">
                <i class="fa fa-graduation-cap"></i>
            </div>
        </div>
        <div class="absolute top-1/3 right-1/4 w-32 h-32 rounded-full bg-accent/10 animate-float" style="animation-delay: -4s">
            <div class="w-full h-full flex items-center justify-center text-accent/20 text-5xl education-icon">
                <i class="fa fa-lightbulb-o"></i>
            </div>
        </div>
        <div class="absolute bottom-1/3 left-1/3 w-28 h-28 rounded-full bg-primary/10 animate-float" style="animation-delay: -1s">
            <div class="w-full h-full flex items-center justify-center text-primary/20 text-4xl education-icon">
                <i class="fa fa-pencil-square-o"></i>
            </div>
        </div>
    </div>

    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white/90 backdrop-blur-sm shadow-sm transition-all duration-300">
        <div class="container mx-auto px-4 py-3 flex items-center justify-between">
            <div class="flex items-center space-x-2">
                <div class="w-10 h-10 bg-primary/10 rounded-xl flex items-center justify-center text-primary">
                    <i class="fa fa-book"></i>
                </div>
                <h1 class="text-xl font-bold text-dark ml-0 md:ml-[-2rem]">智慧题库管理系统</h1>
            </div>
            
            <!-- 顶部导航 -->
            <div class="hidden md:flex items-center space-x-2">
                <div class="nav-item" data-section="dashboard">
                    <i class="fa fa-home mr-2"></i> 控制面板
                </div>
                <div class="nav-item" data-section="question">
                    <i class="fa fa-book mr-2"></i> 题库管理
                </div>
                <div class="nav-item active" data-section="textbook">
                    <i class="fa fa-archive mr-2"></i> 教材管理
                </div>
                <div class="nav-item" data-section="statistics">
                    <i class="fa fa-bar-chart mr-2"></i> 数据分析
                </div>
                <div class="nav-item" data-section="settings">
                    <i class="fa fa-cog mr-2"></i> 系统设置
                </div>
            </div>
            
            <div class="flex items-center space-x-4">
                <button class="p-2 text-muted hover:text-primary transition-colors relative">
                    <i class="fa fa-bell"></i>
                    <span class="absolute top-1 right-1 w-2 h-2 bg-accent rounded-full"></span>
                </button>
                <div class="flex items-center space-x-2">
                    <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="w-8 h-8 rounded-full object-cover border-2 border-primary/20">
                    <span class="hidden md:inline text-sm font-medium text-dark">张老师</span>
                    <i class="fa fa-angle-down text-muted"></i>
                </div>
                <button class="md:hidden p-2 text-muted hover:text-primary transition-colors" id="mobile-menu-button">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
        </div>
    </header>

    <!-- 主内容区 -->
    <main class="flex-grow flex">
        <!-- 左侧导航栏 -->
        <aside id="sidebar" class="w-64 bg-sidebar-bg shadow-sidebar transition-all duration-300 h-[calc(100vh-64px)] sticky top-[64px] overflow-y-auto">
            <!-- 教材管理菜单 -->
            <div id="textbook-menu" class="sidebar-menu active">
                <div class="p-4 border-b border-gray-200">
                    <h3 class="text-sm font-medium text-muted uppercase tracking-wider">教材管理</h3>
                </div>
                <div class="p-2">
                    <div class="sidebar-item">
                        <i class="fa fa-list"></i>
                        <span>教材列表</span>
                    </div>
                    <div class="sidebar-item">
                        <i class="fa fa-plus-circle"></i>
                        <span>添加教材</span>
                    </div>
                    <div class="sidebar-item active">
                        <i class="fa fa-versions"></i>
                        <span>版本管理</span>
                    </div>
                    <div class="sidebar-item">
                        <i class="fa fa-book-chapter"></i>
                        <span>章节管理</span>
                    </div>
                    <div class="sidebar-item">
                        <i class="fa fa-tags"></i>
                        <span>知识点管理</span>
                    </div>
                    <div class="sidebar-item">
                        <i class="fa fa-upload"></i>
                        <span>教材导入</span>
                    </div>
                </div>
            </div>
        </aside>

        <!-- 内容区域 -->
        <div class="flex-grow p-6">
            <!-- 页面标题与操作区 -->
            <div class="mb-8">
                <div class="flex flex-col md:flex-row md:items-center md:justify-between">
                    <div>
                        <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-dark">教材版本列表</h2>
                        <p class="text-muted mt-2">管理各教材的版本信息，支持版本对比与维护</p>
                    </div>
                </div>
            </div>

        </div>
    </main>

    <!-- JavaScript -->
    <script>
        // 页面初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 章节/小节折叠展开逻辑
            document.querySelectorAll('.chapter-toggle').forEach(toggle => {
                toggle.addEventListener('click', function() {
                    const targetId = this.getAttribute('data-target');
                    const targetElement = document.getElementById(targetId);
                    const icon = this.querySelector('i');
                    
                    targetElement.classList.toggle('hidden');
                    if (targetElement.classList.contains('hidden')) {
                        icon.classList.remove('fa-chevron-down');
                        icon.classList.add('fa-chevron-right');
                    } else {
                        icon.classList.remove('fa-chevron-right');
                        icon.classList.add('fa-chevron-down');
                    }
                });
            });
            
            // 移动端菜单切换
            const mobileMenuButton = document.getElementById('mobile-menu-button');
            const sidebar = document.getElementById('sidebar');
            
            if (mobileMenuButton && sidebar) {
                mobileMenuButton.addEventListener('click', function() {
                    sidebar.classList.toggle('-translate-x-full');
                });
            }
            
            // 初始化移动端侧边栏状态
            function checkScreenSize() {
                if (window.innerWidth < 768) {
                    sidebar.classList.add('-translate-x-full');
                } else {
                    sidebar.classList.remove('-translate-x-full');
                }
            }
            
            // 初始检查
            checkScreenSize();
            
            // 窗口大小变化时检查
            window.addEventListener('resize', checkScreenSize);
            
            // 全选/取消全选
            const selectAllCheckbox = document.querySelector('thead input[type="checkbox"]');
            const rowCheckboxes = document.querySelectorAll('tbody input[type="checkbox"]');
            
            if (selectAllCheckbox) {
                selectAllCheckbox.addEventListener('change', function() {
                    rowCheckboxes.forEach(checkbox => {
                        checkbox.checked = this.checked;
                    });
                });
            }
            
            // 表格行悬停效果
            const tableRows = document.querySelectorAll('tbody tr');
            tableRows.forEach(row => {
                row.addEventListener('mouseenter', function() {
                    this.classList.add('bg-gray-50');
                });
                row.addEventListener('mouseleave', function() {
                    if (!this.classList.contains('selected')) {
                        this.classList.remove('bg-gray-50');
                    }
                });
            });
        });
    </script>
</body>
</html>